#!/bin/sh
#这个一个下载更新文件的脚本，脚本运行后会从固定的位
#置获取系统更新包，下载后执行更新

WAP_INFO_FELE="./wap.info"
UPDATE_HTTP_ADDR=`awk '{if ($1=="HTTP_ADDR") {print $2}}' $WAP_INFO_FELE`

if [ -f ./wap800update.zip ];then
	echo "delete old wap800update.zip..."
  rm ./wap800update.zip 
  rm -rf UpdateFile
fi
echo "reay down :$UPDATE_HTTP_ADDR"
wget "$UPDATE_HTTP_ADDR" -O wap800update.zip

if [ -f ./wap800update.zip ];then
	echo "wget get wap800update.zip file ok ^_^"
unzip ./wap800update.zip	

cd UpdateFile
   ./update.sh
else
	echo "wget get wap800update.zip file fail !!!"
	exit 1
fi
exit 0
